package com.han.swagger2markdown.core.other;

import com.han.swagger2markdown.core.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Api("其他场景")
@RestController
@RequestMapping("/others")
public class OtherController {

    @ApiOperation("入参是字符串数组")
    @PostMapping("/arrays")
    public Result<Void> arrays(@RequestParam Integer id, @RequestParam String name,
                               @RequestBody List<String> list) {
        return Result.success();
    }

    @ApiOperation("返回值是字符串数组")
    @PostMapping("/arrays2")
    public Result<List<String>> arrays2(@RequestParam Integer id, @RequestParam String name,
                                        @RequestBody List<String> list) {
        return Result.success(new ArrayList<>());
    }

    @ApiOperation("数组套数组")
    @PostMapping("/arrays3")
    public Result<List<List<String>>> arrays3(@RequestParam Integer id, @RequestParam String name,
                                              @RequestBody List<String> list) {
        return Result.success(new ArrayList<>());
    }
}
